{% extends "public/layout.html" %}

{% block body %}
    <table class="table table-striped">
        <caption><a href="{% url 'idc_add' %}" class="btn btn-primary">添加</a></caption>
        <tr>
            <th>#</th>
            <th>字母简称</th>
            <th>机房名称</th>
            <th>联系人</th>
            <th>联系人电话</th>
            <th>联系人email</th>
            <th>操作</th>

        </tr>
        {% for idc in object_list %}
        <tr>
            <td>{{ forloop.counter }}</td>
            <td>{{ idc.name }}</td>
            <td>{{ idc.idc_name }}</td>
            <td>{{ idc.user }}</td>
            <td>{{ idc.user_phone }}</td>
            <td>{{ idc.user_email }}</td>
            <td>
                <div class="btn-group">
                    <div class="btn-group">
                        <button class="btn btn-primary btn-sm dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="false">
                            修改
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                            <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li>
                            <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li>
                            <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li>
                            <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li>
                        </ul>
                    </div>
                    {% if user.is_active %}
                        <button type="button" class="btn btn-sm btn-warning modify_user_status" status="true" data="{{ user.id }}">禁用</button>
                    {% else %}
                        <button type="button" class="btn btn-sm modify_user_status btn-info" status="false" data="{{ user.id }}">开启</button>
                    {% endif %}
                </div>
            </td>
        </tr>
        {% endfor %}
    </table>
{% endblock %}

